home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2039 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: amaryllisp1.appsig.com!user
  2. From: larry_kearney@appsig.com (Lawrence Kearney)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Not used functions
  5. Date: Thu, 18 Jan 1996 07:19:10 -0700
  6. Organization: Applied Signal Technology
  7. Distribution: world
  8. Message-ID: <larry_kearney-1801960719100001@amaryllisp1.appsig.com>
  9. References: <8B8F2EE.108500D8CB.uuout@dkb.dk>
  10. NNTP-Posting-Host: amaryllisp1.appsig.com
  11.  
  12. >     Question:
  13. >     Now, I have a lot of string definitions and a lot of functions that I do 
  14. > not use anymore. Both strings and functions are not static-declared. I
  15. want to 
  16. > delete these strings and functions. Does anyone know a program who can
  17. check if 
  18. > these are used? Can PC-lint do it?
  19. >     
  20. >     Thanks
  21. >     
  22. >     Roland
  23. >     ro@dkb.dk
  24. >     
  25. >     (If possible please mail me directly (as well as to this group), I 
  26. > only have a lousy program to search through messages and cannot follow 
  27. > branches in a message structure - if you a good program, please inform me)
  28.  
  29. One way to do this is to simply comment out the code using the preprocessor pair
  30.  
  31. #if 0
  32.  
  33. ... code you want to remove ...
  34.  
  35. #endif
  36.  
  37. around the offending sections, recompile, and then link. If you remove
  38. code that is called elsewhere, the linker should bug you about unresolved
  39. references or something like that. Remove the #if around those pieces and
  40. try it again until your program links successfully. You can then delete
  41. the unused code from the source files permanently.
  42.  
  43. -- 
  44. Larry Kearney                   |   "You want fries with that?"
  45. Applied Signal Technology       |
  46. larry_kearney@appsig.com        |
  47.